<?php
namespace App\Server\Model;
use App\Server\Cache\Cache;
class Webconfig extends Model
{

    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'webconfig';

    protected $fillable = ['config_key','config_value','config_msg'];

    public function getCacheInfo($where,$cacheKey,$action='find',$field='*',$ttl=86400){
        $res = parent::getCacheInfo($where,$cacheKey,$action,$field,$ttl);
        return json_decode($res['config_value'],true);
    }

    public function clearCacheData()
    {
        $this->keys = [
            'onewebconfig',  //需要展示的菜单
            'webconfig_web',      //后台所有菜单
            'webconfig_email',  //需要展示的菜单
            'webconfig_sms',      //后台所有菜单
        ];
        return parent::clearCacheData();
    }

}
